package com.example.music.common.config;

import javax.swing.JOptionPane;
/**
 * @author Administrator
 * @Title: ${file_name}
 * @Package ${package_name}
 * @Description: ${todo}
 * @date 2018/12/31 0031下午 9:32
 */
public class TestDemo {

        public static void reverseString (String str){
            if (str.length() == 1){
                System.out.print(str);
            }
            else{
                String subString1 = str.substring(0, str.length()-1);
                String subString2 = str.substring(str.length()-1);

                System.out.print(subString2);

                reverseString (subString1);
            }
        }

        public static void main (String args[]){
            String originalString;

            originalString = JOptionPane.showInputDialog("Please input a String: ");

            reverseString (originalString);
        }
    }
